[−][src]Crate ecies
Elliptic Curve Integrated Encryption Scheme for secp256k1 in Rust, based on pure Rust implementation of secp256k1.
This is the Rust version of eciespy.
Usage
use ecies::{decrypt, encrypt, utils::generate_keypair}; const MSG: &str = "helloworld"; let (sk, pk) = generate_keypair(); let (sk, pk) = (&sk.serialize(), &pk.serialize()); let msg = MSG.as_bytes(); assert_eq!( msg, decrypt(sk, &encrypt(pk, msg).unwrap()).unwrap().as_slice() );
Modules
utils | Utility functions for ecies |
Structs
PublicKey | Public key on a secp256k1 curve. |
SecretKey | Secret key (256-bit) on a secp256k1 curve. |
Enums
SecpError |
Constants
FULL_PUBLIC_KEY_SIZE |
Functions
decrypt | Decrypt a message by a secret key |
encrypt | Encrypt a message by a public key |